﻿using Libs;

namespace WriteForFighting.Game.View.Control
{
    class GraphicButton : ButtonBase
    {
        private int graphHandle;

        public GraphicButton(int par1X, int par2Y,
            int par3CollisionBoxWidth, int par4CollisionBoxHeigh, int par5GraphHandle)
            : base(par1X, par2Y, par3CollisionBoxWidth, par4CollisionBoxHeigh)
        {
            graphHandle = par5GraphHandle;
        }

        public GraphicButton(int par1X, int par2Y, int par3GraphHandle)
            : base(par1X, par2Y, 0, 0)
        {
            graphHandle = par3GraphHandle;

            int w;
            int h;
            DX.GetGraphSize(graphHandle, out w, out h);
            CollisionBoxWidth = w;
            CollisionBoxHeight = h;
        }

        protected override void OnDraw()
        {
            DX.DrawGraph(X, Y, graphHandle, DX.TRUE);
        }
    }
}
